package fhp.hlhj.giantfold.module

import com.lzy.okgo.model.HttpParams
import fhp.hlhj.giantfold.javaBean.BaseBean
import fhp.hlhj.giantfold.network.UrlApis
import fhp.hlhj.giantfold.utils.LogUtil

/**
 * author: FHP
 * data: on 2018\1\29 0029 15:33
 * E-Mail: 103945089@qq.com
 */
class CreateCashModule {
    interface onCommitListener{
        fun showLoading()
        fun onCommit(baseBean: BaseBean)
    }

    fun createCash(params: HttpParams,listener: onCommitListener){
        UrlApis.createGetCash(params)
                .doOnSubscribe {
                    listener.showLoading()
                }
                .subscribe (
                        {
                            data->
                            listener.onCommit(data)
                        },{
                            ero->
                            LogUtil.log("错误信息$ero")
                        }
                )
    }
}